package com.pdd.controller;

import com.pdd.entity.Dept;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import java.util.List;

@Data
@Controller
public class DeptController {
    @Autowired
    private  DeptService deptService;

    public List<Dept> selectAllDept(){return deptService.selectAllDept();};

    public Dept selectOneById(int id){return  deptService.selectOneById(id);};

    public  String  deleteById(int id){return deptService.deleteById(id)?"成功":"失败";};

    public  void addOne (Dept dept){deptService.addOne(dept);};

    public  void updateOne(Dept dept){deptService.updateOne(dept);};
}
